/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SPasswordInfoConverter.java
 * Created：		2016年7月30日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.todo.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.todo.ATaskExecution;
import com.thor.palmmall.spi.todo.STaskExecution;

/**
 * @author wolv
 *
 */
public class STaskExecutionConverter implements Converter<ATaskExecution, STaskExecution> {

	public static STaskExecutionConverter getInstance() {
		if (instance == null)
			instance = new STaskExecutionConverter();
		return instance;
	}

	private static STaskExecutionConverter instance;

	private STaskExecutionConverter() {
	}

	@Override
	public STaskExecution convert(ATaskExecution source) {
		if (source == null)
			return null;

		STaskExecution target = new STaskExecution();
		target.setMessage(source.getMessage());
		target.setOperate(source.getOperate());
		target.setTaskId(source.getTaskId());
		target.setUserId(source.getUserId());

		return target;
	}

}
